<!DOCTYPE html>
<%@page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib uri="/tld/authority.tld" prefix="authority" %>
<%@taglib uri="/tld/navigator.tld" prefix="navigator" %>
<%@taglib uri="/tld/pagination.tld" prefix="page" %>

<%--<div class="pageheader">
    <h2>属性内容管理</h2>

    <div class="breadcrumb-wrapper">
        <span class="left color-999 font13">您当前的位置：</span>
        <ol class="breadcrumb left">
            <li>参数管理</li>
            <li>属性内容管理</li>
        </ol>
    </div>
</div>--%>
<navigator:navigator url="attrParamAlias/query.htm"/>

<div class="contentpanel">

    <div class="panel panel-default">
        <form>

            <input type="hidden" name="start" value="${query.start}">
            <input type="hidden" name="length" value="${query.length}">
            <input type="hidden" name="showType" value="${query.showType}">
            <input type="hidden" name="sortField" value="${query.sortField}">
            <input type="hidden" name="sortType" value="${query.sortType}">

            <div class="row">
                <div class="panel-body panel-body2 border-gray-b">
                    <div class="col-md-6">
                        <div class="form-group">
                            <div class="col-sm-6" style="width: 100%;">
                                <div class="select-container select">
                                    <select class="select select-offscreen Lv1" name="levelOneId">
                                        <option value="">-请选择-</option>
                                        <c:forEach items="${levelOneList}" var="item">
                                            <option value="${item.id}" ${item.id == lv1Id ? 'selected' : ''}>${item.name}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <div class="col-sm-6" style="width: 100%;">
                                <div class="select-container select">
                                    <select class="select select-offscreen Lv2" name="levelTwoId">
                                        <option value="">-请选择-</option>
                                        <c:forEach items="${levelTwoList}" var="item">
                                            <option value="${item.id}" ${item.id == lv2Id ? 'selected' : ''}>${item.name}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="btn-group2 left">
                        <button type="submit" class="btn btn-primary btn-4-query"><i class="icon icon-chaxun"></i>查询
                        </button>
                    </div>
                </div>
            </div>

            <%--<div class="row pt15 condition-4-query" style="display: ${query.showType == 0 ? 'none;' : 'block;'}">
                <div class="panel-body">
                    <div class="col-md-8">
                        <div class="form-group before-after-none" style="display:table; width:100%;">

                        </div>
                    </div>
                </div>
            </div>--%>
        </form>
        <%--<div class="row">
            <div class="shrink ${query.showType == 0 ? '': 'active'}">
                <button type="button" class="shrink-btn btn-default btn-4-toggle">
                    <i class="icon icon-xiala1"></i>
                    <span>${query.showType == 0 ? '展开查询条件': '收起查询条件'}</span>
                </button>
            </div>
        </div>--%>
    </div>


    <div class="panel panel-default">
        <div class="row">
            <div class="panel-body panel-body2  plr20">

                <div class="left">
                    <div class="btn-group left btn-group-none2">
                        <authority:authority url="/attrParamAlias/add">
                            <button type="button" class="btn btn-primary btn-4-add"><i class="icon icon-tianjia"></i>新增
                            </button>
                        </authority:authority>
                    </div>
                </div>

            </div>
        </div>

        <div class="row">
            <div class=" plr20">
                <div class="table-responsive">
                    <table class="table dataTable ">
                        <tbody>
                        <tr>
                            <th width="50">&nbsp;</th>
                            <th width="220"><strong>所属属性</strong></th>
                            <th width="140"><strong>属性名称</strong></th>
                            <th width="140"><strong>分类展示名称</strong></th>
                            <th><strong>对应属性</strong></th>
                            <th width="100"><strong>操作</strong></th>
                        </tr>
                        <c:forEach items="${paging.items}" var="item" varStatus="status">
                            <tr>
                                <td>${(paging.pageIndex - 1) * paging.pageSize + (status.count)}</td>
                                <td>${(0 eq item.level)?(empty item.levelOneName?"~":item.levelOneName):((2 eq item.level)?item.levelOneName:item.levelTwoName)}
                                    / ${(0 eq item.level)?(empty item.levelTwoName?"~":item.levelTwoName):((2 eq item.level)?item.levelTwoName:'~')}</td>
                                <td>${item.name}</td>
                                <td>
                                    <c:forEach items="${attrAliasKeysMap.get(item.id)}" var="alias" varStatus="vo">
                                        <span style="line-height:22px;">${alias}</span> ${not vo.last?"<br/>":""}
                                    </c:forEach>
                                </td>
                                <td>
                                    <c:forEach items="${attrAliasKeysMap.get(item.id)}" var="alias" varStatus="vo">
                                        <c:forEach items="${attrKeysMap.get(item.id).get(alias)}" var="key"
                                                   varStatus="vi">
                                            <span style="line-height:22px;">${key}</span> ${not vi.last?"、":""}
                                        </c:forEach>
                                        ${not vo.last?"<br/>":""}
                                    </c:forEach>
                                </td>
                                <td>
                                    <authority:authority url="/attrParamAlias/add">
                                        <a class="btn-4-modify" data-id="${item.id}">修改</a>
                                    </authority:authority>
                                    <authority:authority url="/attrParamAlias/delete">
                                        <a class="btn-4-delete margin-l-10" data-id="${item.id}">删除</a>
                                    </authority:authority>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
                <page:page pageIndex="${paging.pageIndex}" pageSize="${paging.pageSize}" count="${paging.count}"/>
            </div>
        </div>
    </div>

    <script src="js/dictionary/attr-param-alias-List.js"></script>
</div>
